package com.smartstate.autoMaticControl.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executors;

// @Configuration
// public class ScheduledConfig{
//     @Bean
//     public TaskScheduler taskScheduler() {
//         ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
//         //核心线程池数量，方法: 返回可用处理器的Java虚拟机的数量。
//         taskScheduler.setPoolSize(Runtime.getRuntime().availableProcessors() * 2);
//         return taskScheduler;
//     }
//
// }
